const App = getApp()
let baseUrl = 'http://127.0.0.1:3000'
function post(url,params={},onSuccess,onFail){
  return new Promise((resove,reject)=>{
    wx.request({
      url: `${baseUrl}/${url}`,
      data:params,
      method:"POST",
      success(datas){
        const {data} = datas
        resove(data)
      },
      fail(err){
        reject(err)
      }
    })
  })  
}
module.exports.post = post